﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="StudyTime_1.studyCards1"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    IsTabStop="false"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:StudyTime_1"
    xmlns:common="using:StudyTime_1.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">


    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <!--Background="#FF1B58B8"-->
    <Grid Style="{StaticResource LayoutRootStyle}" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="140*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>


        <VisualStateManager.VisualStateGroups>

            <!-- Visual states reflect the application's view state -->
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>

                <!-- The back button and title have different styles when snapped -->
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <!-- Back button and page title -->
        <Grid Grid.ColumnSpan="2" Background="#FF1B58B8">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock x:Name="pageTitle" Text="Study Cards" Style="{StaticResource PageHeaderTextStyle}" Margin="126,0,733,19" Height="60"/>
            <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}" />
            <TextBlock x:Name="errorBox" Foreground="#FFFF0101" HorizontalAlignment="Left" Height="71" Margin="869,49,0,0" TextAlignment="Right" TextWrapping="Wrap" VerticalAlignment="Top" Width="348"/>
        </Grid>
        <Grid Grid.ColumnSpan="2" Margin="10,5,0,0" x:Name="buttonGrid" Grid.Row="1" VerticalAlignment="Center"  HorizontalAlignment="Center">

            <Button Content="Previous" x:Name="previous" HorizontalAlignment="Left" Height="75" Margin="15.2,430,0,0" VerticalAlignment="Top" Width="252.81" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Click="previous_Click" BorderBrush="#FF1B58B8" Foreground="Black">
                <Button.RenderTransform>
                    <CompositeTransform SkewX="20"  TranslateX="-15" TranslateY="7"/>
                </Button.RenderTransform>
            </Button>
            <Button Content="Next" x:Name="next" HorizontalAlignment="Left" Height="75" Margin="1.7,355,0,0" VerticalAlignment="Top" Width="252" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Click="next_Click" BorderBrush="#FF1B58B8" Foreground="Black">
                <Button.RenderTransform>
                    <CompositeTransform SkewX="-40"  TranslateX="15" TranslateY="7"/>
                </Button.RenderTransform>
            </Button>
            <Button Content="Flip" x:Name="check" HorizontalAlignment="Left" Height="75" Margin="59.5,519.5,0,-0.5" VerticalAlignment="top" Width="252" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto"  Click="check_Click" BorderBrush="#FF1B58B8" Foreground="Black">
                <Button.RenderTransform>
                    <CompositeTransform SkewX="43"  TranslateX="-13.171" TranslateY="-7.469"/>
                </Button.RenderTransform>
            </Button>
            <Button Content="Flip Back" x:Name="flipBack" HorizontalAlignment="Left" Height="75" Margin="-2,365.5,0,0" VerticalAlignment="Top" Width="252" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" d:LayoutRounding="Auto" Click="flipBack_Click" BorderBrush="#FF1B58B8" Foreground="Black" Visibility="Collapsed">
                <Button.RenderTransform>
                    <CompositeTransform SkewX="-20"  TranslateX="15.421" TranslateY="-7.462"/>
                </Button.RenderTransform>
            </Button>
            <Button Content="Select Cards" x:Name="selectCards" HorizontalAlignment="Left" Height="61" Margin="1072,528,0,0" VerticalAlignment="Top" Width="143" RenderTransformOrigin="0.5,0.5" Click="selectCards_Click" BorderBrush="#FF1B58B8" Foreground="Black">
                <!--<Button.RenderTransform>
                    <CompositeTransform SkewX="20"  TranslateX="15.421" TranslateY="-7.462"/>
                </Button.RenderTransform>-->
            </Button>
            <Border BorderBrush="White" BorderThickness="1" Height="439" HorizontalAlignment="Left" Margin="260,10,0,0" x:Name="border1" VerticalAlignment="Top" Width="757" CornerRadius="5">
                <ScrollViewer>
                    <TextBlock x:Name="cardBox"  HorizontalAlignment="Left" Height="599" TextWrapping="Wrap" TextAlignment="Center" VerticalAlignment="Top" Width="747"  FontFamily="Segoe UI" FontSize="22" Foreground="#FF1B58B8"/>
                </ScrollViewer>
            </Border>

            <Grid x:Name="popin">
                <Grid.Resources>
                    <Storyboard x:Name="popinSB">
                        <PopInThemeAnimation Storyboard.TargetName="popin" FromHorizontalOffset="500"/>
                    </Storyboard>
                    <Storyboard x:Name="popoutSB">
                        <PopOutThemeAnimation  Storyboard.TargetName="popin" />
                    </Storyboard>
                </Grid.Resources>
                <ScrollViewer Name="imgScroll" Margin="266,17,212,181" Visibility="Collapsed">
                    <Image x:Name="stImage" HorizontalAlignment="Center"  Height="425" VerticalAlignment="Center" Width="740" Stretch="Uniform"/>
                </ScrollViewer>

            </Grid>
            <Button Content="Image" Name="imagebttn" IsEnabled="False" HorizontalAlignment="Center" Height="50" Margin="1072,454,10,0" VerticalAlignment="Top" Width="143" Click="image_Click" BorderBrush="#FF1B58B8" Foreground="Black"/>
        </Grid>


    </Grid>
</common:LayoutAwarePage>
